<template>
	<view>
		<view @tap="show=true">
			<slot></slot>
		</view>
		
		<view class="fixed z20 wp animated fadeIn fastest" v-if="show" @tap="show = false">
			
			<form @tap.stop="()=>{}" @touchmove.stop.prevent="()=>{}" @submit="onSubmit" class="w80p whiteBg pd animated fadeInLeft fastest" style="height: 100%;">
				
				<scroll-view :scroll-y="true" style="height: 100%;">
					
					<view class="mb10">
						<view class="ptb10 bold">行政区域</view>
						<view class="grayBg rds4">
							<inps @input="data.area = $event" :value="data.area" :showBb="false"
								:list="areaList" :multi="false" placeholder="请输入行政区域"></inps>
							<input type="text" style="display: none;" name="ts.area" v-model="data.area" class="block bd pd10 rds3 grayBg">
						</view>
					</view>
					
					<view class="mb10">
						<view class="ptb10 bold">所属行业</view>
						<view>
							<input type="text" name="ts.monitorNum" v-model="data.monitorNum" class="block bd pd10 rds3 grayBg" placeholder="请输入所属行业">
						</view>
					</view>
					
					<view class="mb10">
						<view class="ptb10 bold">点位类型</view>
						<view class="grayBg rds4">
							<inps @input="data.type = $event" :value="data.type" :showBb="false"
								:list="typeList" :multi="false" placeholder="请输入点位类型"></inps>
							<input type="text" style="display: none;" name="ts.type" v-model="data.type" class="block bd pd10 rds3 grayBg">
						</view>
					</view>
					
					<view class="mb10">
						<view class="ptb10 bold">级别</view>
						<view class="grayBg rds4">
							<inps @input="data.controlLevel = $event" :value="data.type" :showBb="false"
								:list="controlLevelList" :multi="false" placeholder="请输入级别"></inps>
							<input type="text" style="display: none;" name="ts.controlLevel" v-model="data.controlLevel" class="block bd pd10 rds3 grayBg" placeholder="请输入级别">
						</view>
					</view>
					
					<view class="mb10">
						<view class="ptb10 bold">企业名称</view>
						<view>
							<input type="text" name="tc.name" v-model="data.cname" class="block bd pd10 rds3 grayBg" placeholder="请输入企业名称">
						</view>
					</view>
					
					<view class="mb10" v-if="role == 4">
						<view class="ptb10 bold">运维单位</view>
						<view>
							<input type="text" name="tsr.name" v-model="data.name" class="block bd pd10 rds3 grayBg" placeholder="请输入运维单位">
						</view>
					</view>
					
					<view class="pt10">
						<view>
							<button form-type="submit" class="btn block rds4">筛选</button>
						</view>
					</view>
					
					
				</scroll-view>
				
			</form>
		</view>
		
	</view>
</template>

<script>
	export default {
		name:"searchs",
		props:{
			
		},
		
		data() {
			return {
				show : false ,
				data : {},
				role : 1 ,
				areaList : ['衢州市市辖区','衢州市柯城区','衢州市衢江区','衢州市绿色产业集聚区','衢州市龙游县','衢州市江山市','衢州市常山县','衢州市开化县','知慧新城','知造新城'] ,
				typeList : ['废水','清下水','废气','VOCS'] ,
				controlLevelList:['重点源','非重点源']
			};
		},
		
		created() {
			var role = uni.getStorageSync("role");
			this.role = role ;
		},
		
		methods:{
			toggle(isShow){
				this.show = isShow ;
			},
			onSubmit(e){
				this.$emit('submit',e);
			}
		}
	}
</script>
